/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.playground.core.repository;

import com.playground.core.entity.LoggedPlayer;

/**
 *
 * @author Tiago Peres
 */
public interface LoggedPlayerRepository {
    
    /**
     * Saves a LoggedPlayer, if it doesn't exist a new LoggedPlayer is created.
     * 
     * @param loggedPlayer the logged player to be saved
     * @return the saved logged player
     */
    LoggedPlayer save(LoggedPlayer loggedPlayer);
    
    /**
     * Retrieves the logged player with the given id.
     * 
     * @param id The id of the player to be retrieved.
     * @return the user with the given id or null if there's no such user
     */
    LoggedPlayer findOne(long id);
    
    /**
     * Removes from the system the given logged player, if it exists.
     * 
     * @param loggedPlayer the logged player to be removed
     */
    void delete(LoggedPlayer loggedPlayer);
    
    /**
     * Removes all logged players
     */
    void deleteAll();
}
